package fr.epsi.studentsmaps;

import fr.epsi.ressources.Epsirooms;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

public class RoomDetailsActivity extends Activity implements OnClickListener {
	
	
	private TextView nomSalleTV;
	private TextView descTV;
	private TextView nbPlaceTV;
	private ImageView imageView;
	

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.roomdetails);
		
		nomSalleTV = (TextView) findViewById(R.id.textView1);
		descTV =  (TextView) findViewById(R.id.textView2);
		nbPlaceTV = (TextView) findViewById(R.id.textView3);
		imageView = (ImageView) findViewById(R.id.imageView1);
		
		Epsirooms epsi = new Epsirooms();
		
		nomSalleTV.setText(epsi.getRoom(getIntent().getExtras().getInt("extraRoom")).libelle);
		descTV.setText(epsi.getRoom(getIntent().getExtras().getInt("extraRoom")).description);
		nbPlaceTV.setText("Nombre de Places :" + epsi.getRoom(getIntent().getExtras().getInt("extraRoom")).nbPlaces);
		imageView.setImageDrawable(getResources().getDrawable(epsi.getRoom(getIntent().getExtras().getInt("extraRoom")).picture));
	}

	
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}
}
